package com.wangxl.test.simplefactorymodel.simplecomputer;

/**
 * 
  * @author: wangxl
  * @description: 运算工厂类（）
  * @date :2018年8月16日下午2:26:28
  * @email:475524154@qq.com
  * @return:
  * @
 */

public class OperationFactory
{
	public static Operation createOperate(String operate)
	{
		Operation oper = null;
		switch (operate)
		{
		case "+":
			oper = new OperationAdd();
			break;
		case "-":
			oper = new OperationSub();
			break;
		case "*":
			oper = new OperationMul();
			break;
		case "/":
			oper = new OperationDiv();
			break;

		default:
			System.out.println("输入符号有误！ ");
			break;
		}
		return oper;
		
	}

}
